package cn.luischen.controller.admin;

import org.springframework.web.bind.annotation.RequestParam;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import cn.luischen.controller.BaseController;
import org.apache.commons.lang3.StringUtils;
import io.swagger.annotations.ApiOperation;
import cn.luischen.dto.StatisticsDto;
import cn.luischen.service.user.UserService;
import javax.servlet.http.HttpSession;
import cn.luischen.service.site.SiteService;
import org.springframework.web.bind.annotation.PostMapping;
import cn.luischen.model.CommentDomain;
import com.github.pagehelper.PageInfo;
import cn.luischen.model.LogDomain;
import cn.luischen.utils.GsonUtils;
import com.unitspirit.sample.cmbchina.UserServiceImpl2;
import cn.luischen.model.ContentDomain;
import cn.luischen.constant.LogActions;
import cn.luischen.model.UserDomain;
import cn.luischen.service.log.LogService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import javax.servlet.http.HttpServletRequest;
import cn.luischen.utils.APIResponse;
import org.springframework.web.bind.annotation.GetMapping;
import io.swagger.annotations.Api;
import cn.luischen.utils.TaleUtils;
import org.slf4j.Logger;
import org.springframework.web.bind.annotation.ResponseBody;
import cn.luischen.exception.BusinessException;
import cn.luischen.constant.WebConst;

import static org.junit.Assert.fail;
import org.mockito.MockitoAnnotations;
import org.junit.After;
import java.util.Map;
import java.lang.reflect.Method;
import static org.junit.Assert.*;
import java.util.List;
import com.alibaba.fastjson.TypeReference;
import static org.junit.Assert.assertNotNull;
import static org.mockito.ArgumentMatchers.*;
import static org.mockito.Mockito.*;
import org.powermock.reflect.Whitebox;
import org.mockito.Mock;
import org.junit.runner.RunWith;
import java.util.HashMap;
import java.util.ArrayList;
import com.alibaba.fastjson.JSONArray;
import org.powermock.core.classloader.annotations.PrepareForTest;
import static org.junit.Assert.assertEquals;
import org.powermock.modules.junit4.PowerMockRunner;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.junit.rules.ExpectedException;
import org.mockito.InjectMocks;
import org.junit.Test;
import com.unitspirit.runtime.*;
import org.mockito.Mockito;
import com.alibaba.fastjson.JSON;
import org.junit.Rule;
import static org.junit.Assert.assertTrue;
import com.alibaba.fastjson.parser.ParserConfig;

/**
* The class <code>IndexControllerTest</code> contains tests for the class <code>{@link IndexController}</code>.
* Copyright (c) 2020
* 
* @generatedBy UnitSpirit at 2021-09-07 17:51:36
* @version 1.0.20210903
*/

@PowerMockIgnore({ "javax.management.*" })
@RunWith(PowerMockRunner.class)
@PrepareForTest({ cn.luischen.utils.GsonUtils.class, cn.luischen.utils.APIResponse.class,
		cn.luischen.model.UserDomain.class })
public class IndexController_saveProfile_WGTest {

	@InjectMocks
	cn.luischen.controller.admin.IndexController unitspirit_fixture;
	@Mock
	cn.luischen.service.user.UserService mock_UserService;
	@Mock
	cn.luischen.service.site.SiteService mock_SiteService;
	@Mock
	cn.luischen.service.log.LogService mock_LogService;

	@Rule
	public ExpectedException unitspirit_thrown = ExpectedException.none();

	/**
	* 测试方法初始化.
	* 
	* @throws Exception 
	*         if the initialization fails for some reason 
	*  
	* @generatedBy UnitSpirit at 2021-09-07 17:51:36
	*/
	@org.junit.Before
	public void setUp() throws Exception {
		try {
			GlobalUnitInit.init();
			MockitoAnnotations.initMocks(this);
			ParserConfig.getGlobalInstance().setAutoTypeSupport(true);
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

	/**
	* @date 2021-09-07 17:51:37
	* @see cn.luischen.controller.admin.IndexController#saveProfile
	* @category auto generate by UnitSpirit  
	* @author UnitSpirit   
	*/
	@Test
	public void test_saveProfile_0113_190019_049_1_02() throws Throwable {
		unitspirit_fixture = PowerMockito.spy(unitspirit_fixture);
		//被测函数参数定义
		String String_p_0 = "admin12";
		String String_p_1 = "1034683568@qq.com";
		javax.servlet.http.HttpServletRequest HttpServletRequest_p_2 = Mockito
				.mock(javax.servlet.http.HttpServletRequest.class);
		javax.servlet.http.HttpSession HttpSession_p_3 = Mockito.mock(javax.servlet.http.HttpSession.class);
		//成员变量设置

		ThreadLocal<Long> m_un_startTime = new ThreadLocal<>();
		m_un_startTime.set(1L);
		Whitebox.setInternalState(unitspirit_fixture, "startTime", m_un_startTime);
		//返回值定义 
		String result_expected = "{\"code\":\"success\"}";

		cn.luischen.model.UserDomain mock_result_UserDomain16 = JSON.parseObject(
				"{\"activated\":0,\"created\":1490756162,\"email\":\"1034683568@qq.com\",\"groupName\":\"visitor\",\"logged\":0,\"password\":\"a66abb5684c45962d887564f08346e8d\",\"screenName\":\"admin1\",\"uid\":1,\"username\":\"admin\"}",
				cn.luischen.model.UserDomain.class);
		PowerMockito.doReturn(mock_result_UserDomain16).when(unitspirit_fixture)
				.user(Mockito.any(javax.servlet.http.HttpServletRequest.class));
		cn.luischen.model.UserDomain mock_sub_caller_UserDomain15 = PowerMockito
				.mock(cn.luischen.model.UserDomain.class);
		Integer mock_result_Integer14 = 1;
		Integer Integermock13_0 = 1;
		String Stringrepeat_mock12_0 = "admin12";
		String Stringrepeat_mock4_0 = "admin12";
		String Stringrepeat_mock11_0 = "1034683568@qq.com";
		String Stringrepeat_mock3_0 = "1034683568@qq.com";
		Integer mock_result_Integer10 = 1;
		PowerMockito.mockStatic(cn.luischen.utils.GsonUtils.class);
		java.lang.String mock_result_String9 = "{\"uid\":1,\"password\":\"111111\",\"email\":\"1034683568@qq.com\",\"screenName\":\"admin12\"}";
		String mock_result_String8 = "\"127.0.0.1\"";
		Integer mock_result_Integer7 = 1;
		PowerMockito.doReturn(mock_result_Integer7).when(unitspirit_fixture)
				.getUid(Mockito.any(javax.servlet.http.HttpServletRequest.class));
		String Stringmock6_0 = "修改个人信息";
		String Stringmock6_1 = "{\"uid\":1,\"password\":\"111111\",\"email\":\"1034683568@qq.com\",\"screenName\":\"admin12\"}";
		String Stringmock6_2 = "127.0.0.1";
		Integer Integermock6_3 = 1;
		cn.luischen.model.UserDomain mock_result_UserDomain5 = JSON.parseObject(
				"{\"activated\":0,\"created\":1490756162,\"email\":\"1034683568@qq.com\",\"groupName\":\"visitor\",\"logged\":0,\"password\":\"a66abb5684c45962d887564f08346e8d\",\"screenName\":\"admin1\",\"uid\":1,\"username\":\"admin\"}",
				cn.luischen.model.UserDomain.class);
		String Stringmock2_0 = "login_user";
		Object Objectmock2_1 = null;
		PowerMockito.mockStatic(cn.luischen.utils.APIResponse.class);
		cn.luischen.utils.APIResponse mock_result_APIResponse1 = JSON.parseObject("{\"code\":\"success\"}",
				cn.luischen.utils.APIResponse.class);

		PowerMockito.whenNew(cn.luischen.model.UserDomain.class).withNoArguments()
				.thenReturn(mock_sub_caller_UserDomain15);
		PowerMockito.when(mock_sub_caller_UserDomain15.getUid()).thenReturn(mock_result_Integer14);
		PowerMockito.doNothing().when(mock_sub_caller_UserDomain15).setUid(Mockito.anyInt());
		PowerMockito.when(mock_UserService.updateUserInfo(Mockito.any(cn.luischen.model.UserDomain.class)))
				.thenReturn(mock_result_Integer10);
		PowerMockito.when(cn.luischen.utils.GsonUtils.toJsonString(Mockito.any())).thenReturn(mock_result_String9);
		PowerMockito.when(HttpServletRequest_p_2.getRemoteAddr()).thenReturn(mock_result_String8);
		PowerMockito.doNothing().when(mock_LogService).addLog(anyString(), anyString(), anyString(), Mockito.anyInt());
		PowerMockito.when(HttpSession_p_3.getAttribute(anyString())).thenReturn(mock_result_UserDomain5);
		PowerMockito.doNothing().when(HttpSession_p_3).setAttribute(anyString(), Mockito.any());
		PowerMockito.when(cn.luischen.utils.APIResponse.success()).thenReturn(mock_result_APIResponse1);

		cn.luischen.utils.APIResponse unitspirit_result = unitspirit_fixture.saveProfile(String_p_0, String_p_1,
				HttpServletRequest_p_2, HttpSession_p_3);
		UnitAssert.assertEquals(result_expected, UnitSpiritFastJsonUtil.getJsonString2(unitspirit_result));
	}

	/**
	* @date 2021-09-07 17:51:37
	* @see cn.luischen.controller.admin.IndexController#saveProfile
	* @category auto generate by UnitSpirit  
	* @author UnitSpirit   
	*/
	@Test
	public void test_saveProfile_0113_190019_049_1_01() throws Throwable {
		unitspirit_fixture = PowerMockito.spy(unitspirit_fixture);
		//被测函数参数定义
		String String_p_0 = "admin12";
		String String_p_1 = "1034683568@qq.com";
		javax.servlet.http.HttpServletRequest HttpServletRequest_p_2 = Mockito
				.mock(javax.servlet.http.HttpServletRequest.class);
		javax.servlet.http.HttpSession HttpSession_p_3 = Mockito.mock(javax.servlet.http.HttpSession.class);
		//成员变量设置

		ThreadLocal<Long> m_un_startTime = new ThreadLocal<>();
		m_un_startTime.set(1L);
		Whitebox.setInternalState(unitspirit_fixture, "startTime", m_un_startTime);
		//返回值定义 
		String result_expected = "{\"code\":\"success\"}";

		cn.luischen.model.UserDomain mock_result_UserDomain16 = JSON.parseObject(
				"{\"activated\":0,\"created\":1490756162,\"email\":\"1034683568@qq.com\",\"groupName\":\"visitor\",\"logged\":0,\"password\":\"a66abb5684c45962d887564f08346e8d\",\"screenName\":\"admin1\",\"uid\":1,\"username\":\"admin\"}",
				cn.luischen.model.UserDomain.class);
		PowerMockito.doReturn(mock_result_UserDomain16).when(unitspirit_fixture)
				.user(Mockito.any(javax.servlet.http.HttpServletRequest.class));
		cn.luischen.model.UserDomain mock_sub_caller_UserDomain15 = PowerMockito
				.mock(cn.luischen.model.UserDomain.class);
		Integer mock_result_Integer14 = 1;
		Integer Integermock13_0 = 1;
		String Stringrepeat_mock12_0 = "admin12";
		String Stringrepeat_mock4_0 = "admin12";
		String Stringrepeat_mock11_0 = "1034683568@qq.com";
		String Stringrepeat_mock3_0 = "1034683568@qq.com";
		Integer mock_result_Integer10 = 1;
		PowerMockito.mockStatic(cn.luischen.utils.GsonUtils.class);
		java.lang.String mock_result_String9 = "{\"uid\":1,\"password\":\"111111\",\"email\":\"1034683568@qq.com\",\"screenName\":\"admin12\"}";
		String mock_result_String8 = "\"127.0.0.1\"";
		Integer mock_result_Integer7 = 1;
		PowerMockito.doReturn(mock_result_Integer7).when(unitspirit_fixture)
				.getUid(Mockito.any(javax.servlet.http.HttpServletRequest.class));
		String Stringmock6_0 = "修改个人信息";
		String Stringmock6_1 = "{\"uid\":1,\"password\":\"111111\",\"email\":\"1034683568@qq.com\",\"screenName\":\"admin12\"}";
		String Stringmock6_2 = "127.0.0.1";
		Integer Integermock6_3 = 1;
		cn.luischen.model.UserDomain mock_result_UserDomain5 = JSON.parseObject(
				"{\"activated\":0,\"created\":1490756162,\"email\":\"1034683568@qq.com\",\"groupName\":\"visitor\",\"logged\":0,\"password\":\"a66abb5684c45962d887564f08346e8d\",\"screenName\":\"admin1\",\"uid\":1,\"username\":\"admin\"}",
				cn.luischen.model.UserDomain.class);
		String Stringmock2_0 = "login_user";
		Object Objectmock2_1 = null;
		PowerMockito.mockStatic(cn.luischen.utils.APIResponse.class);
		cn.luischen.utils.APIResponse mock_result_APIResponse1 = JSON.parseObject("{\"code\":\"success\"}",
				cn.luischen.utils.APIResponse.class);

		PowerMockito.whenNew(cn.luischen.model.UserDomain.class).withNoArguments()
				.thenReturn(mock_sub_caller_UserDomain15);
		PowerMockito.when(mock_sub_caller_UserDomain15.getUid()).thenReturn(mock_result_Integer14);
		PowerMockito.doNothing().when(mock_sub_caller_UserDomain15).setUid(Mockito.anyInt());
		PowerMockito.when(mock_UserService.updateUserInfo(Mockito.any(cn.luischen.model.UserDomain.class)))
				.thenReturn(mock_result_Integer10);
		PowerMockito.when(cn.luischen.utils.GsonUtils.toJsonString(Mockito.any())).thenReturn(mock_result_String9);
		PowerMockito.when(HttpServletRequest_p_2.getRemoteAddr()).thenReturn(mock_result_String8);
		PowerMockito.doNothing().when(mock_LogService).addLog(anyString(), anyString(), anyString(), Mockito.anyInt());
		PowerMockito.when(HttpSession_p_3.getAttribute(anyString())).thenReturn(mock_result_UserDomain5);
		PowerMockito.doNothing().when(HttpSession_p_3).setAttribute(anyString(), Mockito.any());
		PowerMockito.when(cn.luischen.utils.APIResponse.success()).thenReturn(mock_result_APIResponse1);

		cn.luischen.utils.APIResponse unitspirit_result = unitspirit_fixture.saveProfile(String_p_0, String_p_1,
				HttpServletRequest_p_2, HttpSession_p_3);
		UnitAssert.assertEquals(result_expected, UnitSpiritFastJsonUtil.getJsonString2(unitspirit_result));
	}

	/**
	* @date 2021-09-07 17:51:37
	* @see cn.luischen.controller.admin.IndexController#saveProfile
	* @category auto generate by UnitSpirit  
	* @author UnitSpirit   
	*/
	@Test
	public void test_saveProfile_0113_190019_049_2_02() throws Throwable {
		unitspirit_fixture = PowerMockito.spy(unitspirit_fixture);
		//被测函数参数定义
		String String_p_0 = "admin12";
		String String_p_1 = "1034683568@qq.com";
		javax.servlet.http.HttpServletRequest HttpServletRequest_p_2 = Mockito
				.mock(javax.servlet.http.HttpServletRequest.class);
		javax.servlet.http.HttpSession HttpSession_p_3 = Mockito.mock(javax.servlet.http.HttpSession.class);
		//成员变量设置

		ThreadLocal<Long> m_un_startTime = new ThreadLocal<>();
		m_un_startTime.set(1L);
		Whitebox.setInternalState(unitspirit_fixture, "startTime", m_un_startTime);
		//返回值定义 
		String result_expected = "{\"code\":\"success\"}";

		cn.luischen.model.UserDomain mock_result_UserDomain16 = JSON.parseObject(
				"{\"activated\":0,\"created\":1490756162,\"email\":\"1034683568@qq.com\",\"groupName\":\"visitor\",\"logged\":0,\"password\":\"a66abb5684c45962d887564f08346e8d\",\"screenName\":\"admin1\",\"uid\":1,\"username\":\"admin\"}",
				cn.luischen.model.UserDomain.class);
		PowerMockito.doReturn(mock_result_UserDomain16).when(unitspirit_fixture)
				.user(Mockito.any(javax.servlet.http.HttpServletRequest.class));
		cn.luischen.model.UserDomain mock_sub_caller_UserDomain15 = PowerMockito
				.mock(cn.luischen.model.UserDomain.class);
		Integer mock_result_Integer14 = 1;
		Integer Integermock13_0 = 1;
		String Stringrepeat_mock12_0 = "admin12";
		String Stringrepeat_mock4_0 = "admin12";
		String Stringrepeat_mock11_0 = "1034683568@qq.com";
		String Stringrepeat_mock3_0 = "1034683568@qq.com";
		Integer mock_result_Integer10 = 1;
		PowerMockito.mockStatic(cn.luischen.utils.GsonUtils.class);
		java.lang.String mock_result_String9 = "{\"uid\":1,\"password\":\"111111\",\"email\":\"1034683568@qq.com\",\"screenName\":\"admin12\"}";
		String mock_result_String8 = "\"127.0.0.1\"";
		Integer mock_result_Integer7 = 1;
		PowerMockito.doReturn(mock_result_Integer7).when(unitspirit_fixture)
				.getUid(Mockito.any(javax.servlet.http.HttpServletRequest.class));
		String Stringmock6_0 = "修改个人信息";
		String Stringmock6_1 = "{\"uid\":1,\"password\":\"111111\",\"email\":\"1034683568@qq.com\",\"screenName\":\"admin12\"}";
		String Stringmock6_2 = "127.0.0.1";
		Integer Integermock6_3 = 1;
		cn.luischen.model.UserDomain mock_result_UserDomain5 = JSON.parseObject(
				"{\"activated\":0,\"created\":1490756162,\"email\":\"1034683568@qq.com\",\"groupName\":\"visitor\",\"logged\":0,\"password\":\"a66abb5684c45962d887564f08346e8d\",\"screenName\":\"admin1\",\"uid\":1,\"username\":\"admin\"}",
				cn.luischen.model.UserDomain.class);
		String Stringmock2_0 = "login_user";
		Object Objectmock2_1 = null;
		PowerMockito.mockStatic(cn.luischen.utils.APIResponse.class);
		cn.luischen.utils.APIResponse mock_result_APIResponse1 = JSON.parseObject("{\"code\":\"success\"}",
				cn.luischen.utils.APIResponse.class);

		PowerMockito.whenNew(cn.luischen.model.UserDomain.class).withNoArguments()
				.thenReturn(mock_sub_caller_UserDomain15);
		PowerMockito.when(mock_sub_caller_UserDomain15.getUid()).thenReturn(mock_result_Integer14);
		PowerMockito.doNothing().when(mock_sub_caller_UserDomain15).setUid(Mockito.anyInt());
		PowerMockito.when(mock_UserService.updateUserInfo(Mockito.any(cn.luischen.model.UserDomain.class)))
				.thenReturn(mock_result_Integer10);
		PowerMockito.when(cn.luischen.utils.GsonUtils.toJsonString(Mockito.any())).thenReturn(mock_result_String9);
		PowerMockito.when(HttpServletRequest_p_2.getRemoteAddr()).thenReturn(mock_result_String8);
		PowerMockito.doNothing().when(mock_LogService).addLog(anyString(), anyString(), anyString(), Mockito.anyInt());
		PowerMockito.when(HttpSession_p_3.getAttribute(anyString())).thenReturn(mock_result_UserDomain5);
		PowerMockito.doNothing().when(HttpSession_p_3).setAttribute(anyString(), Mockito.any());
		PowerMockito.when(cn.luischen.utils.APIResponse.success()).thenReturn(mock_result_APIResponse1);

		cn.luischen.utils.APIResponse unitspirit_result = unitspirit_fixture.saveProfile(String_p_0, String_p_1,
				HttpServletRequest_p_2, HttpSession_p_3);
		UnitAssert.assertEquals(result_expected, UnitSpiritFastJsonUtil.getJsonString2(unitspirit_result));
	}

	/**
	* @date 2021-09-07 17:51:37
	* @see cn.luischen.controller.admin.IndexController#saveProfile
	* @category auto generate by UnitSpirit  
	* @author UnitSpirit   
	*/
	@Test
	public void test_saveProfile_0113_190019_049_2_01() throws Throwable {
		unitspirit_fixture = PowerMockito.spy(unitspirit_fixture);
		//被测函数参数定义
		String String_p_0 = "admin12";
		String String_p_1 = "1034683568@qq.com";
		javax.servlet.http.HttpServletRequest HttpServletRequest_p_2 = Mockito
				.mock(javax.servlet.http.HttpServletRequest.class);
		javax.servlet.http.HttpSession HttpSession_p_3 = Mockito.mock(javax.servlet.http.HttpSession.class);
		//成员变量设置

		ThreadLocal<Long> m_un_startTime = new ThreadLocal<>();
		m_un_startTime.set(1L);
		Whitebox.setInternalState(unitspirit_fixture, "startTime", m_un_startTime);
		//返回值定义 
		String result_expected = "{\"code\":\"success\"}";

		cn.luischen.model.UserDomain mock_result_UserDomain16 = JSON.parseObject(
				"{\"activated\":0,\"created\":1490756162,\"email\":\"1034683568@qq.com\",\"groupName\":\"visitor\",\"logged\":0,\"password\":\"a66abb5684c45962d887564f08346e8d\",\"screenName\":\"admin1\",\"uid\":1,\"username\":\"admin\"}",
				cn.luischen.model.UserDomain.class);
		PowerMockito.doReturn(mock_result_UserDomain16).when(unitspirit_fixture)
				.user(Mockito.any(javax.servlet.http.HttpServletRequest.class));
		cn.luischen.model.UserDomain mock_sub_caller_UserDomain15 = PowerMockito
				.mock(cn.luischen.model.UserDomain.class);
		Integer mock_result_Integer14 = 1;
		Integer Integermock13_0 = 1;
		String Stringrepeat_mock12_0 = "admin12";
		String Stringrepeat_mock4_0 = "admin12";
		String Stringrepeat_mock11_0 = "1034683568@qq.com";
		String Stringrepeat_mock3_0 = "1034683568@qq.com";
		Integer mock_result_Integer10 = 1;
		PowerMockito.mockStatic(cn.luischen.utils.GsonUtils.class);
		java.lang.String mock_result_String9 = "{\"uid\":1,\"password\":\"111111\",\"email\":\"1034683568@qq.com\",\"screenName\":\"admin12\"}";
		String mock_result_String8 = "\"127.0.0.1\"";
		Integer mock_result_Integer7 = 1;
		PowerMockito.doReturn(mock_result_Integer7).when(unitspirit_fixture)
				.getUid(Mockito.any(javax.servlet.http.HttpServletRequest.class));
		String Stringmock6_0 = "修改个人信息";
		String Stringmock6_1 = "{\"uid\":1,\"password\":\"111111\",\"email\":\"1034683568@qq.com\",\"screenName\":\"admin12\"}";
		String Stringmock6_2 = "127.0.0.1";
		Integer Integermock6_3 = 1;
		cn.luischen.model.UserDomain mock_result_UserDomain5 = JSON.parseObject(
				"{\"activated\":0,\"created\":1490756162,\"email\":\"1034683568@qq.com\",\"groupName\":\"visitor\",\"logged\":0,\"password\":\"a66abb5684c45962d887564f08346e8d\",\"screenName\":\"admin1\",\"uid\":1,\"username\":\"admin\"}",
				cn.luischen.model.UserDomain.class);
		String Stringmock2_0 = "login_user";
		Object Objectmock2_1 = null;
		PowerMockito.mockStatic(cn.luischen.utils.APIResponse.class);
		cn.luischen.utils.APIResponse mock_result_APIResponse1 = JSON.parseObject("{\"code\":\"success\"}",
				cn.luischen.utils.APIResponse.class);

		PowerMockito.whenNew(cn.luischen.model.UserDomain.class).withNoArguments()
				.thenReturn(mock_sub_caller_UserDomain15);
		PowerMockito.when(mock_sub_caller_UserDomain15.getUid()).thenReturn(mock_result_Integer14);
		PowerMockito.doNothing().when(mock_sub_caller_UserDomain15).setUid(Mockito.anyInt());
		PowerMockito.when(mock_UserService.updateUserInfo(Mockito.any(cn.luischen.model.UserDomain.class)))
				.thenReturn(mock_result_Integer10);
		PowerMockito.when(cn.luischen.utils.GsonUtils.toJsonString(Mockito.any())).thenReturn(mock_result_String9);
		PowerMockito.when(HttpServletRequest_p_2.getRemoteAddr()).thenReturn(mock_result_String8);
		PowerMockito.doNothing().when(mock_LogService).addLog(anyString(), anyString(), anyString(), Mockito.anyInt());
		PowerMockito.when(HttpSession_p_3.getAttribute(anyString())).thenReturn(mock_result_UserDomain5);
		PowerMockito.doNothing().when(HttpSession_p_3).setAttribute(anyString(), Mockito.any());
		PowerMockito.when(cn.luischen.utils.APIResponse.success()).thenReturn(mock_result_APIResponse1);

		cn.luischen.utils.APIResponse unitspirit_result = unitspirit_fixture.saveProfile(String_p_0, String_p_1,
				HttpServletRequest_p_2, HttpSession_p_3);
		UnitAssert.assertEquals(result_expected, UnitSpiritFastJsonUtil.getJsonString2(unitspirit_result));
	}

	/**
	* @date 2021-09-07 17:51:38
	* @see cn.luischen.controller.admin.IndexController#saveProfile
	* @category auto generate by UnitSpirit  
	* @author UnitSpirit   
	*/
	@Test
	public void test_saveProfile_1126_111348_147_1_02() throws Throwable {
		unitspirit_fixture = PowerMockito.spy(unitspirit_fixture);
		//被测函数参数定义
		String String_p_0 = "admin1";
		String String_p_1 = "1034683568@qq.com";
		javax.servlet.http.HttpServletRequest HttpServletRequest_p_2 = Mockito
				.mock(javax.servlet.http.HttpServletRequest.class);
		javax.servlet.http.HttpSession HttpSession_p_3 = Mockito.mock(javax.servlet.http.HttpSession.class);
		//成员变量设置

		ThreadLocal<Long> m_un_startTime = new ThreadLocal<>();
		m_un_startTime.set(1L);
		Whitebox.setInternalState(unitspirit_fixture, "startTime", m_un_startTime);
		//返回值定义 
		String result_expected = "{\"code\":\"success\"}";

		cn.luischen.model.UserDomain mock_result_UserDomain4 = JSON.parseObject(
				"{\"activated\":0,\"created\":1490756162,\"email\":\"1034683568@qq.com\",\"groupName\":\"visitor\",\"logged\":0,\"password\":\"a66abb5684c45962d887564f08346e8d\",\"screenName\":\"admin\",\"uid\":1,\"username\":\"admin\"}",
				cn.luischen.model.UserDomain.class);
		PowerMockito.doReturn(mock_result_UserDomain4).when(unitspirit_fixture)
				.user(Mockito.any(javax.servlet.http.HttpServletRequest.class));
		Integer mock_result_Integer3 = 1;
		PowerMockito.doReturn(mock_result_Integer3).when(unitspirit_fixture).getUid(Mockito.any());
		cn.luischen.model.UserDomain mock_result_UserDomain2 = JSON.parseObject(
				"{\"activated\":0,\"created\":1490756162,\"email\":\"1034683568@qq.com\",\"groupName\":\"visitor\",\"logged\":0,\"password\":\"a66abb5684c45962d887564f08346e8d\",\"screenName\":\"admin\",\"uid\":1,\"username\":\"admin\"}",
				cn.luischen.model.UserDomain.class);
		String Stringmock1_0 = "login_user";
		Object Objectmock1_1 = null;

		PowerMockito.when(HttpSession_p_3.getAttribute(anyString())).thenReturn(mock_result_UserDomain2);
		PowerMockito.doNothing().when(HttpSession_p_3).setAttribute(anyString(), Mockito.any());

		cn.luischen.utils.APIResponse unitspirit_result = unitspirit_fixture.saveProfile(String_p_0, String_p_1,
				HttpServletRequest_p_2, HttpSession_p_3);
		UnitAssert.assertEquals(result_expected, UnitSpiritFastJsonUtil.getJsonString2(unitspirit_result));
	}

	/**
	* @date 2021-09-07 17:51:38
	* @see cn.luischen.controller.admin.IndexController#saveProfile
	* @category auto generate by UnitSpirit  
	* @author UnitSpirit   
	*/
	@Test
	public void test_saveProfile_1126_111348_147_1_01() throws Throwable {
		unitspirit_fixture = PowerMockito.spy(unitspirit_fixture);
		//被测函数参数定义
		String String_p_0 = "admin1";
		String String_p_1 = "1034683568@qq.com";
		javax.servlet.http.HttpServletRequest HttpServletRequest_p_2 = Mockito
				.mock(javax.servlet.http.HttpServletRequest.class);
		javax.servlet.http.HttpSession HttpSession_p_3 = Mockito.mock(javax.servlet.http.HttpSession.class);
		//成员变量设置

		ThreadLocal<Long> m_un_startTime = new ThreadLocal<>();
		m_un_startTime.set(1L);
		Whitebox.setInternalState(unitspirit_fixture, "startTime", m_un_startTime);
		//返回值定义 
		String result_expected = "{\"code\":\"success\"}";

		cn.luischen.model.UserDomain mock_result_UserDomain4 = JSON.parseObject(
				"{\"activated\":0,\"created\":1490756162,\"email\":\"1034683568@qq.com\",\"groupName\":\"visitor\",\"logged\":0,\"password\":\"a66abb5684c45962d887564f08346e8d\",\"screenName\":\"admin\",\"uid\":1,\"username\":\"admin\"}",
				cn.luischen.model.UserDomain.class);
		PowerMockito.doReturn(mock_result_UserDomain4).when(unitspirit_fixture)
				.user(Mockito.any(javax.servlet.http.HttpServletRequest.class));
		Integer mock_result_Integer3 = 1;
		PowerMockito.doReturn(mock_result_Integer3).when(unitspirit_fixture).getUid(Mockito.any());
		cn.luischen.model.UserDomain mock_result_UserDomain2 = JSON.parseObject(
				"{\"activated\":0,\"created\":1490756162,\"email\":\"1034683568@qq.com\",\"groupName\":\"visitor\",\"logged\":0,\"password\":\"a66abb5684c45962d887564f08346e8d\",\"screenName\":\"admin\",\"uid\":1,\"username\":\"admin\"}",
				cn.luischen.model.UserDomain.class);
		String Stringmock1_0 = "login_user";
		Object Objectmock1_1 = null;

		PowerMockito.when(HttpSession_p_3.getAttribute(anyString())).thenReturn(mock_result_UserDomain2);
		PowerMockito.doNothing().when(HttpSession_p_3).setAttribute(anyString(), Mockito.any());

		cn.luischen.utils.APIResponse unitspirit_result = unitspirit_fixture.saveProfile(String_p_0, String_p_1,
				HttpServletRequest_p_2, HttpSession_p_3);
		UnitAssert.assertEquals(result_expected, UnitSpiritFastJsonUtil.getJsonString2(unitspirit_result));
	}

	/**
	* @date 2021-09-07 17:51:38
	* @see cn.luischen.controller.admin.IndexController#saveProfile
	* @category auto generate by UnitSpirit  
	* @author UnitSpirit   
	*/
	@Test
	public void test_saveProfile_1126_124407_210_1_02() throws Throwable {
		unitspirit_fixture = PowerMockito.spy(unitspirit_fixture);
		//被测函数参数定义
		String String_p_0 = "admin";
		String String_p_1 = "1034683568@qq.com";
		javax.servlet.http.HttpServletRequest HttpServletRequest_p_2 = Mockito
				.mock(javax.servlet.http.HttpServletRequest.class);
		javax.servlet.http.HttpSession HttpSession_p_3 = Mockito.mock(javax.servlet.http.HttpSession.class);
		//成员变量设置

		ThreadLocal<Long> m_un_startTime = new ThreadLocal<>();
		m_un_startTime.set(1L);
		Whitebox.setInternalState(unitspirit_fixture, "startTime", m_un_startTime);
		//返回值定义 
		String result_expected = "{\"code\":\"success\"}";

		cn.luischen.model.UserDomain mock_result_UserDomain4 = JSON.parseObject(
				"{\"activated\":0,\"created\":1490756162,\"email\":\"1034683568@qq.com\",\"groupName\":\"visitor\",\"logged\":0,\"password\":\"a66abb5684c45962d887564f08346e8d\",\"screenName\":\"admin11\",\"uid\":1,\"username\":\"admin\"}",
				cn.luischen.model.UserDomain.class);
		PowerMockito.doReturn(mock_result_UserDomain4).when(unitspirit_fixture)
				.user(Mockito.any(javax.servlet.http.HttpServletRequest.class));
		Integer mock_result_Integer3 = 1;
		PowerMockito.doReturn(mock_result_Integer3).when(unitspirit_fixture).getUid(Mockito.any());
		cn.luischen.model.UserDomain mock_result_UserDomain2 = JSON.parseObject(
				"{\"activated\":0,\"created\":1490756162,\"email\":\"1034683568@qq.com\",\"groupName\":\"visitor\",\"logged\":0,\"password\":\"a66abb5684c45962d887564f08346e8d\",\"screenName\":\"admin11\",\"uid\":1,\"username\":\"admin\"}",
				cn.luischen.model.UserDomain.class);
		String Stringmock1_0 = "login_user";
		Object Objectmock1_1 = null;

		PowerMockito.when(HttpSession_p_3.getAttribute(anyString())).thenReturn(mock_result_UserDomain2);
		PowerMockito.doNothing().when(HttpSession_p_3).setAttribute(anyString(), Mockito.any());

		cn.luischen.utils.APIResponse unitspirit_result = unitspirit_fixture.saveProfile(String_p_0, String_p_1,
				HttpServletRequest_p_2, HttpSession_p_3);
		UnitAssert.assertEquals(result_expected, UnitSpiritFastJsonUtil.getJsonString2(unitspirit_result));
	}

	/**
	* @date 2021-09-07 17:51:38
	* @see cn.luischen.controller.admin.IndexController#saveProfile
	* @category auto generate by UnitSpirit  
	* @author UnitSpirit   
	*/
	@Test
	public void test_saveProfile_1126_124407_210_1_01() throws Throwable {
		unitspirit_fixture = PowerMockito.spy(unitspirit_fixture);
		//被测函数参数定义
		String String_p_0 = "admin";
		String String_p_1 = "1034683568@qq.com";
		javax.servlet.http.HttpServletRequest HttpServletRequest_p_2 = Mockito
				.mock(javax.servlet.http.HttpServletRequest.class);
		javax.servlet.http.HttpSession HttpSession_p_3 = Mockito.mock(javax.servlet.http.HttpSession.class);
		//成员变量设置

		ThreadLocal<Long> m_un_startTime = new ThreadLocal<>();
		m_un_startTime.set(1L);
		Whitebox.setInternalState(unitspirit_fixture, "startTime", m_un_startTime);
		//返回值定义 
		String result_expected = "{\"code\":\"success\"}";

		cn.luischen.model.UserDomain mock_result_UserDomain4 = JSON.parseObject(
				"{\"activated\":0,\"created\":1490756162,\"email\":\"1034683568@qq.com\",\"groupName\":\"visitor\",\"logged\":0,\"password\":\"a66abb5684c45962d887564f08346e8d\",\"screenName\":\"admin11\",\"uid\":1,\"username\":\"admin\"}",
				cn.luischen.model.UserDomain.class);
		PowerMockito.doReturn(mock_result_UserDomain4).when(unitspirit_fixture)
				.user(Mockito.any(javax.servlet.http.HttpServletRequest.class));
		Integer mock_result_Integer3 = 1;
		PowerMockito.doReturn(mock_result_Integer3).when(unitspirit_fixture).getUid(Mockito.any());
		cn.luischen.model.UserDomain mock_result_UserDomain2 = JSON.parseObject(
				"{\"activated\":0,\"created\":1490756162,\"email\":\"1034683568@qq.com\",\"groupName\":\"visitor\",\"logged\":0,\"password\":\"a66abb5684c45962d887564f08346e8d\",\"screenName\":\"admin11\",\"uid\":1,\"username\":\"admin\"}",
				cn.luischen.model.UserDomain.class);
		String Stringmock1_0 = "login_user";
		Object Objectmock1_1 = null;

		PowerMockito.when(HttpSession_p_3.getAttribute(anyString())).thenReturn(mock_result_UserDomain2);
		PowerMockito.doNothing().when(HttpSession_p_3).setAttribute(anyString(), Mockito.any());

		cn.luischen.utils.APIResponse unitspirit_result = unitspirit_fixture.saveProfile(String_p_0, String_p_1,
				HttpServletRequest_p_2, HttpSession_p_3);
		UnitAssert.assertEquals(result_expected, UnitSpiritFastJsonUtil.getJsonString2(unitspirit_result));
	}
}
